﻿using System.Web.UI;
using System.Web.UI.WebControls;

/// <summary>
/// Summary description for ResponseMessage
/// </summary>

namespace UI.Library.Web
{
    [SupportsEventValidation, ValidationProperty("Message")]
    [ToolboxData("<{0}:ResponseMessage runat=server></{0}:ResponseMessage>")]
    public class ResponseMessage : Literal
    {
        private string _message;
        public string Message
        {
            get { return this._message; }
            set { this._message = value; }
        }

        public void SetSuccessMessage(string message)
        {
            Message = message;
            this.Text = "<div class='success'>" + message + "</div>";
            this.Visible = true;
        }

        public void SetFailMessage(string message)
        {
            Message = message;
            this.Text = "<div class='error' >" + message + "</div>";
            this.Visible = true;
        }

        public void SetNoticeMessage(string message)
        {
            Message = message;
            this.Text = "<div class='notice' >" + message + "</div>";
            this.Visible = true;
        }

        public ResponseMessage()
        {
            this.Visible = false;
        }
    }
}